package br.ufrgs.rescue.model;

import java.io.Serializable;
import rescuecore2.standard.entities.Building;

public class BuildingOnFire extends MyMessage implements Serializable {
    //Quantidade de água necessária para apagar o incêndio

    private int water = 0;
    private int civilians = 0;
    //
    // Atributos para alimentar a rede neural;
    //
    private int fieryness = 0;
    private int temperature = 0;
    private int totalArea = 0;
    private int composition = 0;

    public BuildingOnFire(Building building) {
        super();
        setId(building.getID().getValue());
        this.fieryness = building.getFierynessEnum().ordinal();
        this.temperature = building.getTemperature();
        this.totalArea = building.getTotalArea();
        this.composition = building.getBuildingCodeProperty().getValue();
        this. civilians = 0; //adicionar civil;
    }
    
    public BuildingOnFire(BuildingOnFire building) {
        super();
        setId(building.getId().getValue());
        this.fieryness = building.getFieryness();
        this.temperature = building.getTemperature();
        this.totalArea = building.getTotalArea();
        this.composition = building.getComposition();
        this.civilians = building.getCivilians();
    }

    public int getWater() {
        return water;
    }

    public void setWater(int water) {
        this.water = water;
    }

    public int getCivilians() {
        return civilians;
    }

    public void setCivilians(int civilians) {
        this.civilians = civilians;
    }

    public int getFieryness() {
        return fieryness;
    }

    public void setFieryness(int fieryness) {
        this.fieryness = fieryness;
    }

    public int getTemperature() {
        return temperature;
    }

    public void setTemperature(int temperature) {
        this.temperature = temperature;
    }

    public int getTotalArea() {
        return totalArea;
    }

    public void setTotalArea(int totalArea) {
        this.totalArea = totalArea;
    }

    public int getComposition() {
        return composition;
    }

    public void setComposition(int composition) {
        this.composition = composition;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 11 * hash + this.water;
        hash = 11 * hash + this.civilians;
        hash = 11 * hash + this.fieryness;
        hash = 11 * hash + this.temperature;
        hash = 11 * hash + this.totalArea;
        hash = 11 * hash + this.composition;
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final BuildingOnFire other = (BuildingOnFire) obj;
        if (this.water != other.water) {
            return false;
        }
        if (this.civilians != other.civilians) {
            return false;
        }
        if (this.fieryness != other.fieryness) {
            return false;
        }
        if (this.temperature != other.temperature) {
            return false;
        }
        if (this.totalArea != other.totalArea) {
            return false;
        }
        if (this.composition != other.composition) {
            return false;
        }
        return true;
    }
}
